import AES from 'crypto-js/aes'
import encUtf8 from 'crypto-js/enc-utf8'

const urlKey = 'query'

/**
 * 加密
 * @param data
 */
export const encrypt = (data: string) => {
  return AES.encrypt(data, urlKey).toString()
}

/**
 * 解密
 * @param encryptedData
 */
export const decrypt = (encryptedData: string) => {
  return AES.decrypt(encryptedData, urlKey).toString(encUtf8)
}
